package cn.yunhe.biz;

import cn.yunhe.exception.OutOfStockException;

public class PhoneImpl implements PhoneBiz{
    int num1;
    @Override
    public void buyPhone(int num) {
        System.out.println("购买手机的总数量："+num);
        this.num1=num;
    }

    @Override
    public void salePhone(int num) throws OutOfStockException {
        if (this.num1<num){
            throw new OutOfStockException("卖出手机总数量"+num+"不能大于实际总数量"+this.num1);
        }
        System.out.println("销售手机的总数量："+num);
    }
}
